package model;

/**
 * Created by Esferat on 02.08.2014.
 */

import org.testng.ITestResult;
import org.testng.annotations.*;

import java.lang.reflect.Method;


public class TestBase {

    protected static TestManager app;
    protected static UserHelper uh;

    @BeforeSuite
    public void setUp() throws Exception {
        app = TestManager.getInstance();
        uh = app.getUserHelper();
    }

    @AfterSuite
    public void tearDown() throws Exception {
        TestManager.getInstance().stop();
    }

    @BeforeMethod
    public void beforeMethod(final Method method) {
        System.out.println("Running test: " + method.getName());
    }

    @AfterMethod(alwaysRun = true)
    public void getScreenshot(ITestResult result) throws Exception {
        uh.takeScreenshot(result);
    }

}
